/* store中的类型定义 */
interface IStorePropsType {
  store: IStoreType;
  todo?: todoType;
}
//store类型定义
interface IStoreType {
  //属性类型定义
  nowstate: string;
  thistodo: any;
  todos: todoType[]; //{ id: any, updatetime: string[], content: string, state: string, start: string, deadline: string }[],
  visible: boolean;
  isShow: string;
  isSrarch: boolean;
  srarch: string;
  batchdel: boolean;
  batchdels: string[];
  //这里是计算属性
  getDay: getDayType;
  filterTodos: getDoneArrType;
  searchResult: getDayType;
  getArrObj: getDayType;

  //这里是增删改查接口
  addTodos(params: object): void;
  updateTodos(params: object): void;
  updateTodoState(id: string, state: string): void;
  handleClearRecyle(): void;

  //这里是其他方法
  changeVisible(): void;
  hadleNowstate(nowstate?: string): void;
  handleshowRender(todo: any): void;
  initTodos(): void;
  handleIsShow(isshow: string): void;
  handleSrarch(value: string): void;
  jwtSign(): void;
  onChangefromTodoContent(value: string): void;
  onChangefromTodoTime(start: any, deadline: any): void;
  handleBatchdel(batchdel?: boolean): void;
  addBatchdels(id: string): void;
  clearBatchdels(): void;
  clearBatchdelsNoDel(): void;
  getCollectByID(id: string): boolean;
}

//用于再from组件中提交定义使用
type todoType = {
  id: any;
  updatetime: updateType[];
  content: string;
  state: string;
  start: string;
  deadline: string;
  collect: boolean;
};
//计算属性计算剩余时间返回值类型
type getDayType = {
  weekArr: todoType[];
  futerArr: todoType[];
  pastArr: todoType[];
};
//计算属性计算剩余时间返回值类型
type getDoneArrType = {
  doneArr: todoType[];
  undoneArr: todoType[];
  recycleArr: todoType[];
  todosArr: todoType[];
};
type updateType = {
  updatetime: string;
  updatestate: string;
};
/********************   定义参数类型 ******************************** */
//定义点击事件event类型
type IeventType = {
  target: {
    value: string;
    getAttribute(params: string): any;
    parentNode: any;
  };
};
//定义表单时间参数
type timeType = {
  _d: { getTime(): any };
};
//定义列表传参函数对象类型
type FuncArr = {
  showModal: () => void;
  handleGetTodoByid: (e: IeventType) => void;
  handleDone: (e: IeventType, state: string) => void;
  addBatchdels: (e: IeventType) => void;
};
//定义登陆成功后加密存储信息类型接口
interface InfoType {
  username?: string;
  password?: string;
  checked?: boolean;
  head?: string;
  create_time?: any;
  id: any;
  todos: any;
}
